-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build and tests with pari 2.17 #38749
base: develop
Are you sure you want to change the base?
Conversation
Needs work because this is not compatible with 2.15. So either it needs to be merged with the pari upgrade or be made to work with older pari too (no idea how). Running tests now. |
Many test failures. |
a6acbfb
to
f619b6f
Compare
If the changes here eventually allow us to use a system Pari 2.17, then we should undo the change in #38772. |
With this MR and the cypari fixes sagemath/cypari2#165 and sagemath/cypari2#166 all tests are passing with pari 2.17. The changes are not compatible with 2.15 though, making them compatible requires more work. Also, some pari opeations (such as the number field prime ideals above a given prime) give random output with 2.17, which makes it harder to test. To solve both issues (and make tests more future proof), we should gradually move away from testing the exact output to just testing that the output is correct. |
257246c
to
b3c57e1
Compare
NEXT_PRIME_VIADIFF is removed in 2.17, port pari_prime_range to pari_PRIMES instead
Co-authored-by: Gonzalo Tornaría <[email protected]>
Co-authored-by: Gonzalo Tornaría <[email protected]>
There seems to be a major issue with pari 2.17: the computation of the units of a bnf is not deterministic:
And also (related?) generators of ideals:
and factorization are non-deterministic as well:
This is making tests a bit unstable, because running in |
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
Yes, see #38749 (comment). I have only tested with |
I am also seeing one test failure with a specific random seed:
This is not reproducible with pari 2.15, but I don't know if it's because of some pari change or because the pari upgrade influences the choice of random timeouts. The obvious fix (adding |
@antonio-rojas I can reproduce it deterministically with pari 2.15 and 2.17 with this change: --- a/src/sage/rings/integer.pyx 2024-08-23 10:46:19.000000000 -0300
+++ b/src/sage/rings/integer.pyx 2024-11-06 11:23:36.666702122 -0300
@@ -3075,9 +3075,9 @@
so a memory leak will not go unnoticed)::
sage: n = prod(primes_first_n(25)) # needs sage.libs.pari
- sage: for i in range(20): # long time # needs sage.libs.pari
+ sage: for t in [0.5, 0.003]:
....: try:
- ....: alarm(RDF.random_element(1e-3, 0.5))
+ ....: alarm(t)
....: _ = n.divisors()
....: cancel_alarm() # we never get here
....: except AlarmInterrupt: I couldn't reproduce this outside doctesting this file. EDIT: the point is that with this change, the failure happens every time, regardless of seed, and regardless of |
Sure, but there is still something weird with this. Some of the I found other issues with In principle, this new |
BTW: I'm preparing a patch for 32-bit. Besides all the unstability, pari 2.17 changed the default real precision to be 128 bits for both 64-bit and 32-bit arches (previously it was 128 bits = 38 digits for 64-bit arch and 96 bit = 28 digits for 32-bit arch). |
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
More updates in antonio-rojas#4 |
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
We need to remove this function from cypari2, because pari 2.17 has changed precision from words to bits which would cause confusion. Besides, the current usage is incorrect, since `log_pari.precision()` will give the precision in *decimal digits* not in words. See: sagemath#38749 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#38908 Reported by: Gonzalo Tornaría Reviewer(s): Vincent Delecroix
6d7c793
to
fbb32fd
Compare
NEXT_PRIME_VIADIFF
is removed in 2.17, portpari_prime_range
topari_PRIMES
insteadNeeds sagemath/cypari2#165 applied to cypari